package com.naughty.shopapi.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.naughty.shopapi.handler.AESEncryptHandler;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Accessors(chain = true)
public class Users implements Serializable {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String name;
    private String email;
    @JsonIgnore
    private String password;   //@TableField(typeHandler = AESEncryptHandler.class) //AES加密处理
    private String phone;
    private String avatar;
    private String avatar_url;
    private Integer is_locked;
    private String openid;
    @JsonIgnore
    private Date password_verified;
    @JsonIgnore
    private String remember_token;
    @TableField(fill = FieldFill.INSERT)
    private Date created_at;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updated_at;
}
